const Koa = require('koa')
const app = new Koa()

const one = (ctx, next) => {
  console.log(1);
  next() // 直接调用下一个中间件
  console.log(2);
  // next() 写这就可以继续执行
}
const two = (ctx, next) => {
  console.log(3);
  next()
  console.log(4);
}
const three = (ctx, next) => {
  console.log(5);
  next()
  console.log(6);
}

app.use(one)

app.use(three)
app.use(two)

app.listen(3000)

// 1 3 5 6 4 2
// 如果都不写 next 只输出1 2 ，只会执行第一个函数